const install = (Vue,vm) => 
{
    let check = () => {
        let LoginUser = uni.getStorageSync('LoginUser')

        // 判断是否登录
        if(!LoginUser || LoginUser == '{}')
        {
            uni.showToast({
                title: '请先登录',
                icon:'error',
                duration: 1500
            });
            

            //关闭其他界面，跳转到底部导航栏的我的界面
            setTimeout(() => {
                uni.switchTab({
                    url: '/pages/base/index'
                })
            }, 1500)

            return false
        }
    }

    vm.$u.auth = {
        check
    }
}

export default{
    install
}